s = input().split(" ")
year = int(s[0])
m = int(s[1])
q = int(s[2])
if m == 1 or m == 2:
    year -= 1
    m += 12
j = year // 100
k = year % 100
h = (q + 26 * (m + 1) // 10 + k + k // 4 + j // 4 + 5 * j) % 7
if h == 0:
    print("星期六")
elif h == 1:
    print("星期天")
elif h == 2:
    print("星期一")
elif h == 3:
    print("星期二")
elif h == 4:
    print("星期三")
elif h == 5:
    print("星期四")
elif h == 6:
    print("星期五")